package com.xie.test;

import org.joda.time.DateTime;
import org.joda.time.LocalDate;

/**
 * @author xiezhendong
 * @date 2021/11/2
 */
public class test9 {

    public static final LocalDate MAX_DATE = DateTime.parse("9999-12-31").toLocalDate();

    public static final LocalDate MIN_DATE = DateTime.parse("1970-01-01").toLocalDate();

    public static void main(String[] args) throws Exception {
        LocalDate startDate = DateTime.parse("9999-12-31").toLocalDate();

        checkDate(startDate, startDate);
    }

    private static void checkDate(LocalDate startDate, LocalDate endDate) throws Exception {
        if (startDate != null && startDate.isBefore(MIN_DATE)) {
            throw new Exception("6055024");
        }
        if (endDate != null && endDate.isAfter(MAX_DATE)) {
            throw new Exception("6055024");
        }
    }
}
